package com.free.semantic.common;


public class LocatorNode implements BaseNode {

    private final String nodeName;

    private Range range;

    public LocatorNode(String nodeName) {
        this.nodeName = nodeName;
    }

    public LocatorNode(RangeObj rangeObj) {
        this.range = rangeObj.getRange();
        this.nodeName = rangeObj.getObjectName();
    }

    public LocatorNode(Range range, String nodeName) {
        this.range = range;
        this.nodeName = nodeName;
    }

    @Override
    public String getNodeName() {
        return nodeName;
    }

    @Override
    public Range getRange() {
        return range;
    }

    @Override
    public String toString() {
        return String.format("(%s)", nodeName);
    }
}
